// shield.c
// modefied by emnil@sj	2/2/00

#include <ansi.h>

inherit F_CLEAN_UP;

void remove_effect(object me, int amount);

int exert(object me, object target)
{
	int skill;

	if ((int)me->query_skill("longxiang-boruo", 1) < 50)
		return notify_fail("你的龙象般若功修为还不够。\n");
	if((int)me->query("max_neili")<300)
		return notify_fail("你的内力修为太差，多多打坐吧。\n");
	if( (int)me->query("neili") < 200 ) 
		return notify_fail("你的真气不够。\n");
	if (me->query_temp("xs/shield"))
		return notify_fail("你已经在运真气护体了。\n"); 
	if (me->query_temp("xs/longxiang"))
		return notify_fail("你已经在运真气增加威力了。\n"); 

	skill = (me->query_skill("force") + me->query_skill("parry"))/2/4;

	message_vision(CYN "$N深深吸入一口气，体内真气流转，身周仿佛凝结了一面气盾！\n" NOR, me);

	me->add_temp("apply/parry", skill);
	me->set_temp("xs/shield", 1);
	me->add("neili", -200);

	me->start_call_out( (: call_other, __FILE__, "remove_effect", me, skill :), skill*2);
	if( me->is_fighting() ) me->start_busy(2);

	return 1;
}
void remove_effect(object me, int amount)
{
	if ( (int)me->query_temp("xs/shield") ) {
		me->add_temp("apply/parry", - amount);
		me->delete_temp("xs/shield");
		message_vision(RED "$N脸上红光一闪，骨节啪啪轻响几声，散去了护体真气。\n" NOR, me);
	}
}